import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'

export function getToken() {
  return Cookies.get(TokenKey)
}
export function getIMToken(){
  return localStorage.getItem('IMAdminToken')
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function getLanguage(){
  // 获取浏览器语言
  let userLanguage = navigator.language || navigator.userLanguage || navigator.browserLanguage;
  // 本地存储
  const getItemLanguage = sessionStorage.getItem('language') || userLanguage;
  const language =getItemLanguage || userLanguage;
  return language
}